#ifndef __VECTOR_H__
#define __VECTOR_H__

#include <cstddef>

template <typename T>
class Vector
{
  public:
    Vector();
    ~Vector() { clear(); }

    T& front();
    const T& front() const;
    T& back();
    const T& back() const;
    T& operator[](const size_t index);

    bool empty() const;
    size_t size() const;
    size_t capacity() const;
    void reserve(const size_t newCapactity);

    void push_back();
    void push_front();

    void pop_back();
    void pop_front();

    void insert(size_t pos, const T& data);
    void erase(size_t pos);
    void resize(const size_t newSize, const T& = T{});

    void clear();
    void reverse();
    void sort();

  private:
    void expand_capacity();

    const unsigned growth_factor = 2.0;

    T* data;
    size_t size_;
    size_t capacity_;
};

#endif  //__VECTOR_H__